package member.order.model;

import m.common.model.FieldMeta;
import m.common.model.LinkTableMeta;
import m.common.model.Model;
import m.common.model.type.FieldType;
import member.base.model.BusinessInfo;
import member.base.model.MemberInfo;
import member.base.model.StoreInfo;
import member.base.model.UserInfo;

import java.util.Date;

public abstract class OrderModel extends Model {
    @LinkTableMeta(name="business_oid",table= BusinessInfo.class,description="所属商家")
    private BusinessInfo business;
    @LinkTableMeta(name="member_oid",table= MemberInfo.class,description="会员信息")
    private MemberInfo member;

    @FieldMeta(name="order_no",type= FieldType.STRING,length = 20,description="订单编号")
    private String orderNo;
    @FieldMeta(name="account_date",type= FieldType.DATE,description="订单账期")
    private Date accountDate;
    @FieldMeta(name="input_date",type= FieldType.DATE,defaultValue = "CURRENT_TIMESTAMP",description="录入时间")
    private Date inputDate;
    @LinkTableMeta(name="serve_user_oid",table= UserInfo.class,description="服务员")
    private UserInfo serveUser;
    @LinkTableMeta(name="input_user_oid",table= UserInfo.class,description="录入人")
    private UserInfo inputUser;
    @LinkTableMeta(name="input_store_oid",table= StoreInfo.class,description="录入店铺")
    private StoreInfo inputStore;
    @FieldMeta(name="status",type= FieldType.STRING,description="状态",defaultValue = "N",dictOption = "Y:已确认,N:待确认,A:暂存")
    private String status;
    public final static String StatusSave="A";
    public final static String StatusConfirm="N";
    public final static String StatusDone="Y";
    @LinkTableMeta(name="confirm_user_oid",table= UserInfo.class,description="确认人")
    private UserInfo confirmUser;
    @FieldMeta(name="confirm_date",type=FieldType.DATE,description="确认时间")
    private Date confirmDate;

    public String getOrderNo() {
        return orderNo;
    }

    public void setOrderNo(String orderNo) {
        this.orderNo = orderNo;
    }

    public BusinessInfo getBusiness() {
        return business;
    }

    public void setBusiness(BusinessInfo business) {
        this.business = business;
    }

    public MemberInfo getMember() {
        return member;
    }

    public void setMember(MemberInfo member) {
        this.member = member;
    }

    public Date getAccountDate() {
        return accountDate;
    }

    public void setAccountDate(Date accountDate) {
        this.accountDate = accountDate;
    }

    public Date getInputDate() {
        return inputDate;
    }

    public void setInputDate(Date inputDate) {
        this.inputDate = inputDate;
    }

    public UserInfo getServeUser() {
        return serveUser;
    }

    public void setServeUser(UserInfo serveUser) {
        this.serveUser = serveUser;
    }

    public UserInfo getInputUser() {
        return inputUser;
    }

    public void setInputUser(UserInfo inputUser) {
        this.inputUser = inputUser;
    }

    public StoreInfo getInputStore() {
        return inputStore;
    }

    public void setInputStore(StoreInfo inputStore) {
        this.inputStore = inputStore;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public UserInfo getConfirmUser() {
        return confirmUser;
    }

    public void setConfirmUser(UserInfo confirmUser) {
        this.confirmUser = confirmUser;
    }

    public Date getConfirmDate() {
        return confirmDate;
    }

    public void setConfirmDate(Date confirmDate) {
        this.confirmDate = confirmDate;
    }
}
